.class public Lcom/noshufou/android/su/HomeActivity;
.super Landroid/support/v4/app/FragmentActivity;
.source "HomeActivity.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/noshufou/android/su/HomeActivity$EliteCheck;,
        Lcom/noshufou/android/su/HomeActivity$PagerAdapter;
    }
.end annotation


# static fields
.field private static final MENU_CLEAR_LOG:I = 0x2

.field private static final MENU_ELITE:I = 0x0

.field private static final MENU_GET_ELITE:I = 0x1

.field private static final MENU_PREFERENCES:I = 0x3

.field private static final STATE_SHOW_DETAILS:Ljava/lang/String; = "show_details"


# instance fields
.field public mDualPane:Z

.field private mLoggingEnabled:Z

.field private mPager:Landroid/support/v4/view/ViewPager;

.field private mTitleLogo:Landroid/graphics/drawable/TransitionDrawable;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 33
    invoke-direct {p0}, Landroid/support/v4/app/FragmentActivity;-><init>()V

    .line 43
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/noshufou/android/su/HomeActivity;->mDualPane:Z

    .line 44
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/noshufou/android/su/HomeActivity;->mLoggingEnabled:Z

    .line 33
    return-void
.end method

.method static synthetic access$0(Lcom/noshufou/android/su/HomeActivity;)Landroid/graphics/drawable/TransitionDrawable;
    .locals 1
    .parameter

    .prologue
    .line 47
    iget-object v0, p0, Lcom/noshufou/android/su/HomeActivity;->mTitleLogo:Landroid/graphics/drawable/TransitionDrawable;

    return-object v0
.end method


# virtual methods
.method public closeDetails()V
    .locals 3

    .prologue
    .line 186
    iget-boolean v0, p0, Lcom/noshufou/android/su/HomeActivity;->mDualPane:Z

    if-eqz v0, :cond_0

    .line 187
    invoke-virtual {p0}, Lcom/noshufou/android/su/HomeActivity;->getSupportFragmentManager()Landroid/support/v4/app/FragmentManager;

    move-result-object v0

    .line 188
    const-string v1, "show_details"

    const/4 v2, 0x1

    invoke-virtual {v0, v1, v2}, Landroid/support/v4/app/FragmentManager;->popBackStack(Ljava/lang/String;I)V

    .line 190
    :cond_0
    return-void
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 10
    .parameter "savedInstanceState"

    .prologue
    const v9, 0x7f0a0009

    const/4 v8, 0x1

    .line 51
    invoke-super {p0, p1}, Landroid/support/v4/app/FragmentActivity;->onCreate(Landroid/os/Bundle;)V

    .line 53
    const v6, 0x7f030001

    invoke-virtual {p0, v6}, Lcom/noshufou/android/su/HomeActivity;->setContentView(I)V

    .line 55
    invoke-static {p0}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v4

    .line 56
    .local v4, prefs:Landroid/content/SharedPreferences;
    const-string v6, "pref_logging"

    invoke-interface {v4, v6, v8}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

    move-result v6

    iput-boolean v6, p0, Lcom/noshufou/android/su/HomeActivity;->mLoggingEnabled:Z

    .line 58
    invoke-virtual {p0, v9}, Lcom/noshufou/android/su/HomeActivity;->findViewById(I)Landroid/view/View;

    move-result-object v6

    if-eqz v6, :cond_3

    .line 59
    iput-boolean v8, p0, Lcom/noshufou/android/su/HomeActivity;->mDualPane:Z

    .line 60
    invoke-virtual {p0}, Lcom/noshufou/android/su/HomeActivity;->getSupportFragmentManager()Landroid/support/v4/app/FragmentManager;

    move-result-object v6

    const v7, 0x7f0a0008

    invoke-virtual {v6, v7}, Landroid/support/v4/app/FragmentManager;->findFragmentById(I)Landroid/support/v4/app/Fragment;

    move-result-object v6

    check-cast v6, Lcom/noshufou/android/su/AppListFragment;

    .line 61
    invoke-virtual {v6}, Lcom/noshufou/android/su/AppListFragment;->getListView()Landroid/widget/ListView;

    move-result-object v6

    invoke-virtual {v6, v8}, Landroid/widget/ListView;->setChoiceMode(I)V

    .line 62
    if-nez p1, :cond_0

    .line 63
    iget-boolean v6, p0, Lcom/noshufou/android/su/HomeActivity;->mLoggingEnabled:Z

    if-eqz v6, :cond_2

    .line 64
    invoke-virtual {p0}, Lcom/noshufou/android/su/HomeActivity;->showLog()V

    .line 98
    :cond_0
    :goto_0
    const v6, 0x102002c

    invoke-virtual {p0, v6}, Lcom/noshufou/android/su/HomeActivity;->findViewById(I)Landroid/view/View;

    move-result-object v6

    check-cast v6, Landroid/widget/ImageView;

    invoke-virtual {v6}, Landroid/widget/ImageView;->getDrawable()Landroid/graphics/drawable/Drawable;

    move-result-object v6

    check-cast v6, Landroid/graphics/drawable/TransitionDrawable;

    .line 97
    iput-object v6, p0, Lcom/noshufou/android/su/HomeActivity;->mTitleLogo:Landroid/graphics/drawable/TransitionDrawable;

    .line 99
    new-instance v6, Lcom/noshufou/android/su/HomeActivity$EliteCheck;

    const/4 v7, 0x0

    invoke-direct {v6, p0, v7}, Lcom/noshufou/android/su/HomeActivity$EliteCheck;-><init>(Lcom/noshufou/android/su/HomeActivity;Lcom/noshufou/android/su/HomeActivity$EliteCheck;)V

    const/4 v7, 0x0

    new-array v7, v7, [Ljava/lang/Void;

    invoke-virtual {v6, v7}, Lcom/noshufou/android/su/HomeActivity$EliteCheck;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    .line 101
    new-instance v0, Lcom/noshufou/android/su/widget/ChangeLog;

    invoke-direct {v0, p0}, Lcom/noshufou/android/su/widget/ChangeLog;-><init>(Landroid/content/Context;)V

    .line 102
    .local v0, cl:Lcom/noshufou/android/su/widget/ChangeLog;
    invoke-virtual {v0}, Lcom/noshufou/android/su/widget/ChangeLog;->firstRun()Z

    move-result v6

    if-eqz v6, :cond_1

    .line 103
    invoke-virtual {v0}, Lcom/noshufou/android/su/widget/ChangeLog;->getLogDialog()Landroid/app/AlertDialog;

    move-result-object v6

    invoke-virtual {v6}, Landroid/app/AlertDialog;->show()V

    .line 105
    :cond_1
    return-void

    .line 67
    .end local v0           #cl:Lcom/noshufou/android/su/widget/ChangeLog;
    :cond_2
    const-class v6, Lcom/noshufou/android/su/AppDetailsFragment;

    invoke-virtual {v6}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v6

    invoke-static {p0, v6}, Landroid/support/v4/app/Fragment;->instantiate(Landroid/content/Context;Ljava/lang/String;)Landroid/support/v4/app/Fragment;

    move-result-object v1

    .line 68
    .local v1, detailsFragment:Landroid/support/v4/app/Fragment;
    invoke-virtual {p0}, Lcom/noshufou/android/su/HomeActivity;->getSupportFragmentManager()Landroid/support/v4/app/FragmentManager;

    move-result-object v6

    invoke-virtual {v6}, Landroid/support/v4/app/FragmentManager;->beginTransaction()Landroid/support/v4/app/FragmentTransaction;

    move-result-object v5

    .line 69
    .local v5, transaction:Landroid/support/v4/app/FragmentTransaction;
    const/16 v6, 0x1003

    invoke-virtual {v5, v6}, Landroid/support/v4/app/FragmentTransaction;->setTransition(I)Landroid/support/v4/app/FragmentTransaction;

    .line 70
    invoke-virtual {v5, v9, v1}, Landroid/support/v4/app/FragmentTransaction;->replace(ILandroid/support/v4/app/Fragment;)Landroid/support/v4/app/FragmentTransaction;

    .line 71
    invoke-virtual {v5}, Landroid/support/v4/app/FragmentTransaction;->commit()I

    goto :goto_0

    .line 75
    .end local v1           #detailsFragment:Landroid/support/v4/app/Fragment;
    .end local v5           #transaction:Landroid/support/v4/app/FragmentTransaction;
    :cond_3
    const v6, 0x7f0a0006

    invoke-virtual {p0, v6}, Lcom/noshufou/android/su/HomeActivity;->findViewById(I)Landroid/view/View;

    move-result-object v6

    check-cast v6, Landroid/support/v4/view/ViewPager;

    iput-object v6, p0, Lcom/noshufou/android/su/HomeActivity;->mPager:Landroid/support/v4/view/ViewPager;

    .line 76
    iget-object v6, p0, Lcom/noshufou/android/su/HomeActivity;->mPager:Landroid/support/v4/view/ViewPager;

    invoke-virtual {p0}, Lcom/noshufou/android/su/HomeActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v7

    const v8, 0x7f090004

    invoke-virtual {v7, v8}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I

    move-result v7

    invoke-virtual {v6, v7}, Landroid/support/v4/view/ViewPager;->setPageMargin(I)V

    .line 78
    const v6, 0x7f0a0005

    invoke-virtual {p0, v6}, Lcom/noshufou/android/su/HomeActivity;->findViewById(I)Landroid/view/View;

    move-result-object v3

    check-cast v3, Lcom/noshufou/android/su/widget/PagerHeader;

    .line 79
    .local v3, pagerHeader:Lcom/noshufou/android/su/widget/PagerHeader;
    new-instance v2, Lcom/noshufou/android/su/HomeActivity$PagerAdapter;

    iget-object v6, p0, Lcom/noshufou/android/su/HomeActivity;->mPager:Landroid/support/v4/view/ViewPager;

    invoke-direct {v2, p0, v6, v3}, Lcom/noshufou/android/su/HomeActivity$PagerAdapter;-><init>(Landroid/support/v4/app/FragmentActivity;Landroid/support/v4/view/ViewPager;Lcom/noshufou/android/su/widget/PagerHeader;)V

    .line 81
    .local v2, pagerAdapter:Lcom/noshufou/android/su/HomeActivity$PagerAdapter;
    const-class v6, Lcom/noshufou/android/su/AppListFragment;

    const v7, 0x7f0b0006

    invoke-virtual {v2, v6, v7}, Lcom/noshufou/android/su/HomeActivity$PagerAdapter;->addPage(Ljava/lang/Class;I)V

    .line 82
    iget-boolean v6, p0, Lcom/noshufou/android/su/HomeActivity;->mLoggingEnabled:Z

    if-eqz v6, :cond_4

    .line 83
    const-class v6, Lcom/noshufou/android/su/LogFragment;

    const v7, 0x7f0b0007

    invoke-virtual {v2, v6, v7}, Lcom/noshufou/android/su/HomeActivity$PagerAdapter;->addPage(Ljava/lang/Class;I)V

    goto/16 :goto_0

    .line 85
    :cond_4
    const/16 v6, 0x8

    invoke-virtual {v3, v6}, Lcom/noshufou/android/su/widget/PagerHeader;->setVisibility(I)V

    goto/16 :goto_0
.end method

.method public onCreateOptionsMenu(Landroid/view/Menu;)Z
    .locals 7
    .parameter "menu"

    .prologue
    const v6, 0x7f02001f

    const/4 v5, 0x3

    const/4 v4, 0x2

    const/4 v3, 0x1

    const/4 v2, 0x0

    .line 110
    invoke-static {p0, v2, v2}, Lcom/noshufou/android/su/util/Util;->elitePresent(Landroid/content/Context;ZI)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 112
    const v1, 0x7f0b0008

    .line 111
    invoke-interface {p1, v2, v2, v2, v1}, Landroid/view/Menu;->add(IIII)Landroid/view/MenuItem;

    move-result-object v0

    .line 113
    .local v0, item:Landroid/view/MenuItem;
    invoke-interface {v0, v6}, Landroid/view/MenuItem;->setIcon(I)Landroid/view/MenuItem;

    .line 114
    invoke-static {v0, v3}, Landroid/support/v4/view/MenuCompat;->setShowAsAction(Landroid/view/MenuItem;I)Z

    .line 122
    :goto_0
    iget-boolean v1, p0, Lcom/noshufou/android/su/HomeActivity;->mLoggingEnabled:Z

    if-eqz v1, :cond_0

    .line 124
    const v1, 0x7f0b000b

    .line 123
    invoke-interface {p1, v2, v4, v4, v1}, Landroid/view/Menu;->add(IIII)Landroid/view/MenuItem;

    move-result-object v0

    .line 125
    const v1, 0x7f02001d

    invoke-interface {v0, v1}, Landroid/view/MenuItem;->setIcon(I)Landroid/view/MenuItem;

    .line 126
    invoke-static {v0, v3}, Landroid/support/v4/view/MenuCompat;->setShowAsAction(Landroid/view/MenuItem;I)Z

    .line 130
    :cond_0
    const v1, 0x7f0b0009

    .line 129
    invoke-interface {p1, v2, v5, v5, v1}, Landroid/view/Menu;->add(IIII)Landroid/view/MenuItem;

    move-result-object v0

    .line 131
    const v1, 0x7f02001e

    invoke-interface {v0, v1}, Landroid/view/MenuItem;->setIcon(I)Landroid/view/MenuItem;

    .line 132
    invoke-static {v0, v3}, Landroid/support/v4/view/MenuCompat;->setShowAsAction(Landroid/view/MenuItem;I)Z

    .line 134
    return v3

    .line 117
    .end local v0           #item:Landroid/view/MenuItem;
    :cond_1
    const v1, 0x7f0b0086

    .line 116
    invoke-interface {p1, v2, v3, v3, v1}, Landroid/view/Menu;->add(IIII)Landroid/view/MenuItem;

    move-result-object v0

    .line 118
    .restart local v0       #item:Landroid/view/MenuItem;
    invoke-interface {v0, v6}, Landroid/view/MenuItem;->setIcon(I)Landroid/view/MenuItem;

    .line 119
    invoke-static {v0, v3}, Landroid/support/v4/view/MenuCompat;->setShowAsAction(Landroid/view/MenuItem;I)Z

    goto :goto_0
.end method

.method public onOptionsItemSelected(Landroid/view/MenuItem;)Z
    .locals 5
    .parameter "item"

    .prologue
    const/4 v4, 0x0

    .line 139
    invoke-interface {p1}, Landroid/view/MenuItem;->getItemId()I

    move-result v2

    packed-switch v2, :pswitch_data_0

    .line 158
    :goto_0
    invoke-super {p0, p1}, Landroid/support/v4/app/FragmentActivity;->onOptionsItemSelected(Landroid/view/MenuItem;)Z

    move-result v2

    return v2

    .line 141
    :pswitch_0
    new-instance v0, Landroid/content/Intent;

    invoke-direct {v0}, Landroid/content/Intent;-><init>()V

    .line 142
    .local v0, eliteIntent:Landroid/content/Intent;
    new-instance v2, Landroid/content/ComponentName;

    const-string v3, "com.noshufou.android.su.elite"

    .line 143
    const-string v4, "com.noshufou.android.su.elite.FeaturedAppsActivity"

    invoke-direct {v2, v3, v4}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    .line 142
    invoke-virtual {v0, v2}, Landroid/content/Intent;->setComponent(Landroid/content/ComponentName;)Landroid/content/Intent;

    .line 144
    invoke-virtual {p0, v0}, Lcom/noshufou/android/su/HomeActivity;->startActivity(Landroid/content/Intent;)V

    goto :goto_0

    .line 147
    .end local v0           #eliteIntent:Landroid/content/Intent;
    :pswitch_1
    new-instance v1, Landroid/content/Intent;

    const-string v2, "android.intent.action.VIEW"

    invoke-direct {v1, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 148
    .local v1, mktIntent:Landroid/content/Intent;
    const-string v2, "market://details?id=com.noshufou.android.su.elite"

    invoke-static {v2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v2

    invoke-virtual {v1, v2}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;

    .line 149
    invoke-virtual {p0, v1}, Lcom/noshufou/android/su/HomeActivity;->startActivity(Landroid/content/Intent;)V

    goto :goto_0

    .line 152
    .end local v1           #mktIntent:Landroid/content/Intent;
    :pswitch_2
    invoke-virtual {p0}, Lcom/noshufou/android/su/HomeActivity;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v2

    sget-object v3, Lcom/noshufou/android/su/provider/PermissionsProvider$Logs;->CONTENT_URI:Landroid/net/Uri;

    invoke-virtual {v2, v3, v4, v4}, Landroid/content/ContentResolver;->delete(Landroid/net/Uri;Ljava/lang/String;[Ljava/lang/String;)I

    goto :goto_0

    .line 155
    :pswitch_3
    invoke-static {p0}, Lcom/noshufou/android/su/util/Util;->launchPreferences(Landroid/content/Context;)V

    goto :goto_0

    .line 139
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
        :pswitch_2
        :pswitch_3
    .end packed-switch
.end method

.method public showDetails(J)V
    .locals 7
    .parameter "id"

    .prologue
    const v6, 0x7f0a0009

    .line 162
    iget-boolean v5, p0, Lcom/noshufou/android/su/HomeActivity;->mDualPane:Z

    if-eqz v5, :cond_1

    .line 163
    invoke-virtual {p0}, Lcom/noshufou/android/su/HomeActivity;->getSupportFragmentManager()Landroid/support/v4/app/FragmentManager;

    move-result-object v5

    .line 164
    invoke-virtual {v5, v6}, Landroid/support/v4/app/FragmentManager;->findFragmentById(I)Landroid/support/v4/app/Fragment;

    move-result-object v2

    .line 165
    .local v2, fragment:Landroid/support/v4/app/Fragment;
    instance-of v5, v2, Lcom/noshufou/android/su/AppDetailsFragment;

    if-eqz v5, :cond_0

    .line 166
    check-cast v2, Lcom/noshufou/android/su/AppDetailsFragment;

    .end local v2           #fragment:Landroid/support/v4/app/Fragment;
    invoke-virtual {v2, p1, p2}, Lcom/noshufou/android/su/AppDetailsFragment;->setShownIndex(J)V

    .line 183
    :goto_0
    return-void

    .line 168
    .restart local v2       #fragment:Landroid/support/v4/app/Fragment;
    :cond_0
    new-instance v0, Landroid/os/Bundle;

    invoke-direct {v0}, Landroid/os/Bundle;-><init>()V

    .line 169
    .local v0, bundle:Landroid/os/Bundle;
    const-string v5, "index"

    invoke-virtual {v0, v5, p1, p2}, Landroid/os/Bundle;->putLong(Ljava/lang/String;J)V

    .line 171
    const-class v5, Lcom/noshufou/android/su/AppDetailsFragment;

    invoke-virtual {v5}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v5

    invoke-static {p0, v5, v0}, Landroid/support/v4/app/Fragment;->instantiate(Landroid/content/Context;Ljava/lang/String;Landroid/os/Bundle;)Landroid/support/v4/app/Fragment;

    move-result-object v1

    .line 172
    .local v1, detailsFragment:Landroid/support/v4/app/Fragment;
    invoke-virtual {p0}, Lcom/noshufou/android/su/HomeActivity;->getSupportFragmentManager()Landroid/support/v4/app/FragmentManager;

    move-result-object v5

    invoke-virtual {v5}, Landroid/support/v4/app/FragmentManager;->beginTransaction()Landroid/support/v4/app/FragmentTransaction;

    move-result-object v4

    .line 173
    .local v4, transaction:Landroid/support/v4/app/FragmentTransaction;
    const/16 v5, 0x1003

    invoke-virtual {v4, v5}, Landroid/support/v4/app/FragmentTransaction;->setTransition(I)Landroid/support/v4/app/FragmentTransaction;

    .line 174
    invoke-virtual {v4, v6, v1}, Landroid/support/v4/app/FragmentTransaction;->replace(ILandroid/support/v4/app/Fragment;)Landroid/support/v4/app/FragmentTransaction;

    .line 175
    const-string v5, "show_details"

    invoke-virtual {v4, v5}, Landroid/support/v4/app/FragmentTransaction;->addToBackStack(Ljava/lang/String;)Landroid/support/v4/app/FragmentTransaction;

    .line 176
    invoke-virtual {v4}, Landroid/support/v4/app/FragmentTransaction;->commit()I

    goto :goto_0

    .line 179
    .end local v0           #bundle:Landroid/os/Bundle;
    .end local v1           #detailsFragment:Landroid/support/v4/app/Fragment;
    .end local v2           #fragment:Landroid/support/v4/app/Fragment;
    .end local v4           #transaction:Landroid/support/v4/app/FragmentTransaction;
    :cond_1
    new-instance v3, Landroid/content/Intent;

    const-class v5, Lcom/noshufou/android/su/AppDetailsActivity;

    invoke-direct {v3, p0, v5}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 180
    .local v3, intent:Landroid/content/Intent;
    const-string v5, "index"

    invoke-virtual {v3, v5, p1, p2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;J)Landroid/content/Intent;

    .line 181
    invoke-virtual {p0, v3}, Lcom/noshufou/android/su/HomeActivity;->startActivity(Landroid/content/Intent;)V

    goto :goto_0
.end method

.method public showLog()V
    .locals 3

    .prologue
    .line 193
    iget-boolean v2, p0, Lcom/noshufou/android/su/HomeActivity;->mDualPane:Z

    if-eqz v2, :cond_0

    .line 194
    const-class v2, Lcom/noshufou/android/su/LogFragment;

    invoke-virtual {v2}, Ljava/lang/Class;->getName()Ljava/lang/String;

    move-result-object v2

    invoke-static {p0, v2}, Landroid/support/v4/app/Fragment;->instantiate(Landroid/content/Context;Ljava/lang/String;)Landroid/support/v4/app/Fragment;

    move-result-object v0

    .line 195
    .local v0, logFragment:Landroid/support/v4/app/Fragment;
    invoke-virtual {p0}, Lcom/noshufou/android/su/HomeActivity;->getSupportFragmentManager()Landroid/support/v4/app/FragmentManager;

    move-result-object v2

    invoke-virtual {v2}, Landroid/support/v4/app/FragmentManager;->beginTransaction()Landroid/support/v4/app/FragmentTransaction;

    move-result-object v1

    .line 196
    .local v1, transaction:Landroid/support/v4/app/FragmentTransaction;
    const/16 v2, 0x1003

    invoke-virtual {v1, v2}, Landroid/support/v4/app/FragmentTransaction;->setTransition(I)Landroid/support/v4/app/FragmentTransaction;

    .line 197
    const v2, 0x7f0a0009

    invoke-virtual {v1, v2, v0}, Landroid/support/v4/app/FragmentTransaction;->replace(ILandroid/support/v4/app/Fragment;)Landroid/support/v4/app/FragmentTransaction;

    .line 198
    invoke-virtual {v1}, Landroid/support/v4/app/FragmentTransaction;->commit()I

    .line 200
    .end local v0           #logFragment:Landroid/support/v4/app/Fragment;
    .end local v1           #transaction:Landroid/support/v4/app/FragmentTransaction;
    :cond_0
    return-void
.end method
